﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace HarveyNash.RefactoringAndCodeSmell.Refactoring.ExtractMethod
{
    class After
    {
        private string serviceUrl;
        private int portNumber;
        private bool forceHttps;

        public void Initialize()
        {
            LoadSettings();
            InitLogger();
        }

        private void LoadSettings()
        {
            serviceUrl = ConfigurationManager.AppSettings["ServiceUrl"];
            int.TryParse(ConfigurationManager.AppSettings["PortNumber"], out portNumber);
            bool.TryParse(ConfigurationManager.AppSettings["ForceHttps"], out forceHttps);
        }

        private void InitLogger()
        {
            //...
        }
    }
}
